-
Notifications
You must be signed in to change notification settings - Fork 5
Add lazy io operations #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bpalmeiro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good in general, nice work. It's a bit lacking in the text suite. You have 5 condition cases (if I counted right), and none are tested. For the sake of the pressing time situation I could let that fly and come back later to pay all that technical debt
|
This PR is mildly outdated as I included significant (almost necessary) improvements in an awaiting branch. I did this to make the PRs more feasible for reviewers but I could merge them together in a separate PR if you wish. Thoughts @bpalmeiro ? |
packs/tests/io_test.py
Outdated
| # sanity check that the output is what you expect it is | ||
| for i, sample in enumerate(output_data): | ||
| assert sample == overwrite_data[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert not np.array_equal(np.array(output_data), np.array(overwrite_data))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I missing anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be assert np.array_equal(np.array(output_data), np.array(overwrite_data)),
but yes I'll change this.
bpalmeiro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, you can also add two easy ones to test the first checks by creating an empty file and then trying to save data in it later (to check it creates the group when not there)
packs/tests/io_test.py
Outdated
| # sanity check that the output is what you expect it is | ||
| for i, sample in enumerate(output_data): | ||
| assert sample == overwrite_data[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I missing anything?
packs/tests/io_test.py
Outdated
| vice versa, will write random data to the end of the prior file | ||
| and check that the reader reads out both new and old data | ||
| ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add explicit comment along: testing overwrite flag works when false
bpalmeiro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm satisfied with the test, and following our offline conversation, let's get this PR rolling, expecting improvements already in the pipeline. Good job.
tests cover: - overwriting capabilities (True and False) - fixed-size capabilities (works as expected, errors when expected)
This PR is an offshoot of
include-WD1-processing, and provides the lazyreader()andwriter()functions for memory efficient manipulation of data.Lies on top of #39, so will need to be merged in that order.